package com.bus.core.events;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.context.ApplicationEvent;

@SuppressWarnings("serial")
@Data
@EqualsAndHashCode(callSuper=false)
public abstract class RemoteBusEvent extends ApplicationEvent {

    private final String originService;
    private final String destinationService;

    public RemoteBusEvent(Object source, String originService, String destinationService) {
        super(source);
        this.originService = originService;
        this.destinationService = destinationService;
    }

    public RemoteBusEvent(Object source, String originService) {
        this(source, originService, null);
    }

    public String getName(){
        return this.getClass().getSimpleName();
    }
}
